<?php

define( "WSDL_CACHE_NONE", 0 );

// error_reporting(E_STRICT | E_ALL);
// 
// // Add the library to the include path. This is not neccessary if you've already
// // done so in your php.ini file.
$path = dirname(__FILE__) . '/../../../src';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);

require_once '../BasicOperations/GetAdGroups.php';
include '../AccountManagement/CreateAccount.php';

require_once 'Google/Api/Ads/AdWords/Lib/AdWordsUser.php';
 
$username = "suziethilberg@gmail.com";
$password = "AD6SS3hp4rv8";
$currencyCode = "USD";
$developerToken = "$username++$currencyCode";

//write results to screen to test
echo "Trying printing out keywords from Google Adwords API: "; 

$user = new AdWordsUser(null, $username, $password, $developerToken);
$user->SetDefaultServer("https://adwords-sandbox.google.com/"); 
$user->SetClientId(null);

// try {
//     $campaignService = $user->GetService("CampaignService", 'v201109');
//     $page = $campaignService->get(new Selector());
// } catch (Exception $e) {}


$accountService = $user->GetService("ServicedAccountService", 'v201109');
$selector = new ServicedAccountSelector();
$page = $accountService->get($selector);
 
// foreach ($page->accounts as $account) {
//     print "Customer ID: {$account->customerId}\n";
// }

// try {
//   // Get AdWordsUser from credentials in "../auth.ini"
//   // relative to the AdWordsUser.php file's directory.
//   $user = new AdWordsUser();
// 
//   // Log every SOAP XML request and response.
//   $user->LogAll();
// 
//   // Run the example.
//   CreateAccount($user);
// } catch (Exception $e) {
//   printf("An error has occurred: %s\n", $e->getMessage());
// }



